import Vue from 'vue'   //引入Vue
import Router from 'vue-router'  //引入vue-router
import LoginPage from "@/components/LoginPage";
import IndexPage from "@/components/IndexPage";
import userList from "@/components/pages/UserList";
import HelloPage from "@/components/pages/HelloPage";
import DeptList from "@/components/pages/DeptList";  //引入根目录下的Hello.vue组件

Vue.use(Router)  //Vue全局使用Router

export default new Router({
    routes: [              //配置路由，这里是个数组
        {                    //每一个链接都是一个对象
            path: '/',         //链接路径
           redirect:"/login"
        },
        {
            path: '/login',
            component:LoginPage
        },
        {
            path: '/index',
            component:IndexPage,
            children:[
                {path:"index",component:HelloPage},
                {path:"user",component:userList},
                {path:"dept",component:DeptList}
            ]
        }
    ]
})